package main

import (
	maker2 "api/libs/maker"
	"gitee.com/dreamwood/ez-maker/maker"
)

func main() {
	maker2.Prepare()
	Summary()
	ChangeLog()
}

func Summary() {
	c := maker.CreateTable("Summary", "结存每日汇总", "wms")
	c.AddManyToOne("item", "物品", "ItemSku")
	c.AddText("itemName", "物品名")

	//由于汇总起到一定的历史备查作用，所以常用的关联项目还是该保持冗余的当时的文本内容
	c.AddManyToOne("type", "出入类型", "IOType").SetDesc("出入库类型")
	c.AddText("typeName", "类型名称")
	c.AddInt("ioType", "出入库类型").SetDesc("1=入库，2=出库")
	c.AddInt("ymd", "年月日").SetDesc("不设置此字段进行区段查询的时候会有些困难")
	c.AddInt("y", "年")
	c.AddInt("m", "月")
	c.AddInt("d", "日")
	c.AddFloat("num", "数量")
	c.AddCreateAt()

	c.Generate()
}

func ChangeLog() {
	c := maker.CreateTable("ChangeLog", "变更记录", "wms")
	c.AddInt("itemId", "物品ID")
	c.AddInt("ioType", "出入库类型").SetDesc("1=入库，2=出库")
	c.AddCreateAt()
	c.AddState().SetDesc("0=未处理，1=已处理")
	c.Generate()
}
